Particle Cloud Simulation
Using the same setup as detailed_look.jl or example2(), here we simulate a point cloud getting advected by the flow field. For additional documentation e.g. see : 1, 2, 3, 4
1. Import Software
using IndividualDisplacements, OrdinaryDiffEq, Statistics
p=dirname(pathof(IndividualDisplacements))
include(joinpath(p,"../examples/recipes_plots.jl"))
include(joinpath(p,"../examples/example123.jl"))Main.ex-particle_cloud.OCCA_setup
2. Setup Problem
๐,ฮ=example2_setup()
ii1=5:5:40; ii2=5:5:25
x=vec([x-0.5 for x in ii1, y in ii2])
y=vec([y-0.5 for x in ii1, y in ii2])
xy=transpose([x y])
๐.๐[:] = [0.0,2998*3600.0]
solv(prob) = solve(prob,Tsit5(),reltol=1e-6,abstol=1e-6)
tr = DataFrame( ID=[], x=[], y=[], t = [])
๐ผ = Individuals{Float64}(xy=xy[:,:], ๐=๐, โ! = โฌก, โก = solv, โฝ = postprocess_xy, tr = tr)Individuals{Float64}([4.5 9.5 โฆ 34.5 39.5; 4.5 4.5 โฆ 24.5 24.5], Int64[], 0ร4 DataFrame
, IndividualDisplacements.dxy_dt, IndividualDisplacements.dxy_dt, Main.ex-particle_cloud.solv, IndividualDisplacements.postprocess_xy, (u0 = data type = Float64
cell pos. = [0.5, 0.5, 0.5]
tile array = (1,)
tile sizes = (80, 42)
grid class = PeriodicChannel
MeshArray = gcmarray
version = 0.2.12
, u1 = data type = Float64
cell pos. = [0.5, 0.5, 0.5]
tile array = (1,)
tile sizes = (80, 42)
grid class = PeriodicChannel
MeshArray = gcmarray
version = 0.2.12
, v0 = data type = Float64
cell pos. = [0.5, 0.5, 0.5]
tile array = (1,)
tile sizes = (80, 42)
grid class = PeriodicChannel
MeshArray = gcmarray
version = 0.2.12
, v1 = data type = Float64
cell pos. = [0.5, 0.5, 0.5]
tile array = (1,)
tile sizes = (80, 42)
grid class = PeriodicChannel
MeshArray = gcmarray
version = 0.2.12
, dx = 5000.0, ๐ = [0.0, 1.07928e7], XC = data type = Float32
cell pos. = [0.5, 0.5, 0.5]
tile array = (1,)
tile sizes = (80, 42)
grid class = PeriodicChannel
MeshArray = gcmarray
version = 0.2.12
, YC = data type = Float32
cell pos. = [0.5, 0.5, 0.5]
tile array = (1,)
tile sizes = (80, 42)
grid class = PeriodicChannel
MeshArray = gcmarray
version = 0.2.12
, ioSize = (80, 42)), NamedTuple(), NamedTuple())3. Compute Trajectories
start!(๐ผ)2ร40 Array{Float64,2}:
5.91182 10.5953 11.087 12.6622 โฆ 37.9639 29.12 30.6396
-12.3525 124.028 487.117 478.34 8.68514 19.2392 22.44154. Display results
๐ผ.tr.lon=5000*๐ผ.tr.x
๐ผ.tr.lat=5000*๐ผ.tr.y
plt=PlotBasic(๐ผ.tr,size(xy,2),100000.0)
Compare with trajectory output from MITgcm
#df=read_flt(joinpath(p,"../examples/flt_example/"),Float32)
#ref=PlotBasic(df,size(xy,2),100000.0)This page was generated using Literate.jl.